package sample.client.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import sample.client.event.SelectClientEvent.SelectClientHandler;
import sample.shared.result.Client;

public class SelectClientEvent extends GwtEvent<SelectClientHandler>
{
  public static Type<SelectClientHandler> TYPE = new Type<SelectClientHandler>();
  private Client client;
  
  public Client getClient() {
    return client;
  }

  @Override
  public Type<SelectClientHandler> getAssociatedType() {
    return TYPE;
  }
  
  public SelectClientEvent(Client client) {
    this.client = client;
  }

  @Override
  protected void dispatch(SelectClientHandler handler) {
    handler.onSelectClient(this);
  }

  public interface SelectClientHandler extends EventHandler
  {
    public void onSelectClient(SelectClientEvent e);
  }

}
